<style>
  .transition {
    text-decoration-line: underline;
    text-decoration-style: wavy;
    text-decoration-color: transparent;
    text-decoration-thickness: 0.1rem;
    cursor: pointer;
    transition: .5s;
  }

  .transition:hover {
    /* 下划线color可以和color不一样 */
    color: transparent;

    text-decoration-color: pink;
    text-decoration-thickness: 0.15rem;
    /* color: pink; */
  }
</style>

<p class="transition" data-content="Lorem ibsum dolor Lorem ibsum dolor">Lorem ibsum dolor</p>